﻿using HZY.Framework.Aop.Attributes;

namespace HZY.Framework.Aop.Test;

public class UserService : IAopServiceProvider
{
    public IServiceProvider ServiceProvider { get; set; }

    [AopMo] public IServiceScopeFactory ServiceScopeFactory { get; }

    public UserService(IServiceProvider serviceProvider)
    {
        ServiceProvider = serviceProvider;
    }

    [MemoryCache(CacheDuration = 5000)]
    [Time("获取名称")]
    public string GetName()
    {
        // using var serviceScope = ServiceScopeFactory.CreateScope();
        // var s = serviceScope.ServiceProvider.ToString();
        return "好的。。。" ;
    }
}